|
PHP팁 게시판 |
[1] |
|
등록일:2007-11-13 11:45:29 (0%) 작성자: 제목:파일 내용읽기/저장하기 |
|
<?
//파일 내용읽기
$filename = '파일명';
$file_loc = "파일이 위치한 경로";
$fcontents = file ($file_loc."/".$filename);
while (list ($line_num, $line) = each ($fcontents)) {
$contents .= stripslashes($line);
}
//textarea 등에 붙인다.
echo "<textarea name=contents>$contents</textarea>";
?>
<?
//파일내용 저장
//post로 넘겨받은 contents
$contents = stripslashes($contents);
//저장할 파일명
$filename = '파일명';
$file_loc = "파일이 위치한 경로";
//파일열어서 내용저장
$fp = fopen($file_loc."/".$filename,"w+");
fwrite($fp, $contents);
fclose($fp);
?>
- 선행되어야할 조건 : 쓰기권한
|
[본문링크] 파일 내용읽기/저장하기
|
[1]
|
|
|
|
|
코멘트(이글의 트랙백 주소:/cafe/tb_receive.php?no=1133 |
|
|
|
|
|
|
|
|
|
Copyright byCopyright ⓒ2005, SSISO Community All Rights Reserved.
|
|
|